<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/18/018
 * Time: 9:14
 */

namespace app\validate;


class OrderInfoValidate extends ValidateBase
{
    protected $rule=[
        'id'=>'require|number',
        'order_number'=>'require|number',
        'user_name'=>'require|chs',
        'user_phone'=>'require|checkPhone',
        'user_address'=>'require',
        'order_money'=>'require|number',
        'order_style'=>'require|number',
        'house_type'=>'require|number',
        'design_uid'=>'require|number',
        'introducer_phone'=>'require|checkPhone',
        'duration'=>'require|number',
        'create_time'=>'require|number',
        'create_uid'=>'require|number',
        'starting_time'=>'require|number',
        'site_supervisor_uid'=>'require|number',
        'orderStatus'=>'require',
        'give_up_reason'=>'require',
    ];

    protected $message = [
        'id.require'=>'未获取到修改数据',
        'id.number'=>'修改数据类型错误',
        'order_number.require'=>'未获取到工单号',
        'order_number.number'=>'工单号错误',
        'user_name.require'=>'用户名称必须',
        'user_name.chs'=>'用户名称错误',
        'user_phone.require'=>'用户号码不能为空',
        'user_phone.checkPhone'=>'用户号码错误',
        'user_address.require'=>'地址不能为空',
        'order_money.require'=>'工单金额不能为空',
        'order_money.number'=>'工单金额类型错误',
        'order_style.require'=>'装修风格不能为空',
        'order_style.number'=>'装修风格类型错误',
        'house_type.require'=>'户型必须选择',
        'house_type.number'=>'户型类型错误',
        'design_uid.number'=>'设计师类型错误',
        'design_uid.require'=>'设计师必须选择',
        'introducer_phone.require'=>'介绍人电话不能为空',
        'introducer_phone.checkPhone'=>'介绍人电话不能为空',
        'duration.number'=>'工期类型错误',
        'duration.require'=>'工期不能为空',
        'create_uid.require'=>'未获取到添加人',
        'create_uid.number'=>'未获取到添加人',
        'create_time.number'=>'未获取到添加时间',
        'create_time.require'=>'未获取到添加时间',
        'starting_time.require'=>'开工时间不能为空',
        'starting_time.number'=>'开工时间类型错误',
        'site_supervisor_uid.number'=>'开工时间类型错误',
        'site_supervisor_uid.require'=>'开工时间类型错误',
        'orderStatus.require'=>'工单状态不能为空',
        'give_up_reason.require'=>'废弃理由不能为空'
    ];
    protected $scene =[
        'addOrder'=>[
            'order_number',
            'user_name',
            'user_phone',
            'user_address',
            'order_money',
            'order_style',
            'house_type',
            'design_uid',
            'introducer_phone',
            'duration',
            'create_time',
            'create_uid',
        ]
    ];

}